import request from '@/config/axios'

// 分页
export const getCatTaskPage = async (params: any) => {
  return await request.get({ url: '/system/catTask/page', params })
}

// 详情
export const getCatTaskDetail = async (id: number) => {
  return await request.get({ url: '/system/catTask/detail', params: { id } })
}

// 新增
export const addCatTask = async (data: any) => {
  return await request.post({ url: '/system/catTask/add', data })
}

// 修改
export const editCatTask = async (data: any) => {
  return await request.post({ url: '/system/catTask/edit', data })
}

// 分配用户
export const assignUsers = async (data: { jobId: number; userIds: number[] }) => {
  return await request.post({ url: '/system/catTask/assignUsers', data })
}

// 获取用户分配状态
export const getUserAssignStatus = async (params: { jobId: number }) => {
  return await request.get({ url: '/system/catTask/userAssignStatus', params })
}

// 删除
export const deleteCatTask = async (id: number) => {
  return await request.post({ url: '/system/catTask/delete', params: { id } })
}


